<?php
class ManageUserLock extends Module{
	function ManageUserLock($row){

		CGlobal::$website_title = 'Quản lý thành viên bị khóa';
		Module::Module($row);
		
		if(User::have_permit(ADMIN_USER)){						
							
			switch(Url::get('cmd')){
				case 'unban_nick':							
					$id=(int)Url::get('id',0);
					$user_id=(int)Url::get('user_id',0);
					if($id){							
						DB::update('user',array('block_time'=>0),'id="'.$user_id.'"');						
						DB::update('user_lock',array('unlock_time'=>TIME_NOW,'unlock_user'=>User::user_name()),'id = '.$id);
						User::getUser($id,0,1);
					}
					Url::redirect_url(Url::build_all(array('chk_id','del_all','cmd','id','lock_die_all','hd_ac')));
					break;	
				default:
					require_once 'forms/ManageUserLock.php';
					$this->add_form(new ListUserLockForm());
					break;
			}		
									
		}
		else{
			Url::access_denied();
		}
	}
}
?>
